package ch.connection;

/** Classe per il controllo della password dell'utente POP
 * 
 * @author Giovanni Franza - GPLv3 - 8/6/2011
 *
 */

public class Pass implements Control {
	
	public Object verify( String data, Object obj ) {
		
		if( ((ch.mailbox.User)obj).getPassword().equals( data ) ) {
			System.out.println( "Access to mailbox: " +  ((ch.mailbox.User)obj).getEmailAddress() );
			return obj;
		}
		System.out.println( "Attempt to unauthorized access to mailbox: " +  ((ch.mailbox.User)obj).getEmailAddress() );
		return null;
	}
	public String getResponse( Object obj ) {
		return null;
	}
}
